<?php

class Admin_Form_GalleryItemUpload extends Zend_Form {
	public function init(){
		$translator = new Zend_Translate(
          'array',
          APPLICATION_PATH.'/../library/Nippy/languages/lang.ru.php',
          'ru',
          array('scan' => Zend_Translate::LOCALE_DIRECTORY)
        );
		Zend_Validate_Abstract::setDefaultTranslator($translator);
        
		$element = new Zend_Form_Element_File('newfile');
		//->setDestination('/var/www/upload');
		$element->setLabel('Upload an image:')
			->addValidator('Count', false, 1)
			->addValidator('Extension', false, 'jpg,png,gif')
			->addFilter('Rename',Admin_GalleryItemController::getTmpPath().time().'.tmp');
		$this->addElement($element, 'newfile');
		
		$this->addElement('text', 'alt', array(
            'label'      => 'alt:',
        	'filters'    => array('StringTrim','StripTags'),
            'required'   => false
            )
        );
        
        $this->addElement('text', 'title', array(
            'label'      => 'title:',
        	'filters'    => array('StringTrim','StripTags'),
            'required'   => false
            )
        );
        
        $this->addElement('text', 'Id', array(
            'label'      => 'Id:',
        	'validators' => array('Int'),
            'required'   => false
            )
        );
        
        $this->addElement('text', 'SizeId', array(
            'label'      => 'Id:',
        	'validators' => array('Int'),
            'required'   => false
            )
        );
	}
}

?>